/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.history;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "history_obj_exrightinfo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HistoryObjExRightInfo.findAll", query = "SELECT h FROM HistoryObjExRightInfo h"),
    @NamedQuery(name = "HistoryObjExRightInfo.findById", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.id = :id"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByRegionID", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.regionID = :regionID"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByObj", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.obj = :obj"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByMarketCode", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.marketCode = :marketCode"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByClassCode", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.classCode = :classCode"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByExRightDate", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.exRightDate = :exRightDate"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByRecordeDate", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.recordeDate = :recordeDate"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByCheckInRightDate", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.checkInRightDate = :checkInRightDate"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByCheckInProfitsDate", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.checkInProfitsDate = :checkInProfitsDate"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByDenominator", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.denominator = :denominator"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByMemberA", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.memberA = :memberA"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByMemberB", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.memberB = :memberB"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByProfits", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.profits = :profits"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByReMark", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.reMark = :reMark"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByOwnUserID", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.ownUserID = :ownUserID"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByAlterUserID", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.alterUserID = :alterUserID"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByCreateTime", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.createTime = :createTime"),
    @NamedQuery(name = "HistoryObjExRightInfo.findByTimeStamp", query = "SELECT h FROM HistoryObjExRightInfo h WHERE h.timeStamp = :timeStamp")})
public class HistoryObjExRightInfo implements Serializable {
	public static byte[] EnCode(HistoryObjExRightInfo msg) throws IOException {
		Codec<HistoryObjExRightInfo> Lcode = ProtobufProxy.create(HistoryObjExRightInfo.class);
		return Lcode.encode(msg);
	}
	public static HistoryObjExRightInfo DeCode(byte[] data) throws IOException {
	Codec<HistoryObjExRightInfo> Lcode = ProtobufProxy.create(HistoryObjExRightInfo.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    @Protobuf
	private Integer id;
    @Basic(optional = false)
    @Column(name = "RegionID")
    @Protobuf
	private String regionID;
    @Basic(optional = false)
    @Column(name = "Obj")
    @Protobuf
	private String obj;
    @Basic(optional = false)
    @Column(name = "MarketCode")
    @Protobuf
	private String marketCode;
    @Basic(optional = false)
    @Column(name = "ClassCode")
    @Protobuf
	private String classCode;
    @Basic(optional = false)
    @Column(name = "ExRightDate")
    @Temporal(TemporalType.DATE)
    private Date exRightDate;
	@Protobuf
	private long exRightDateL;
    @Basic(optional = false)
    @Column(name = "RecordeDate")
    @Temporal(TemporalType.DATE)
    private Date recordeDate;
	@Protobuf
	private long recordeDateL;
    @Basic(optional = false)
    @Column(name = "CheckInRightDate")
    @Temporal(TemporalType.DATE)
    private Date checkInRightDate;
	@Protobuf
	private long checkInRightDateL;
    @Basic(optional = false)
    @Column(name = "CheckInProfitsDate")
    @Temporal(TemporalType.DATE)
    private Date checkInProfitsDate;
	@Protobuf
	private long checkInProfitsDateL;
    @Column(name = "Denominator")
    @Protobuf
	private Integer denominator;
    @Column(name = "MemberA")
    @Protobuf
	private Integer memberA;
    @Column(name = "MemberB")
    @Protobuf
	private Integer memberB;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Profits")
    @Protobuf
	private Float profits;
    @Column(name = "ReMark")
    private String reMark;
	@Protobuf
	private byte[] reMarkBit;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public HistoryObjExRightInfo() {
    }

    public HistoryObjExRightInfo(Integer id) {
        this.id = id;
    }

    public HistoryObjExRightInfo(Integer id, String regionID, String obj, String marketCode, String classCode, Date exRightDate, Date recordeDate, Date checkInRightDate, Date checkInProfitsDate) {
        this.id = id;
        this.regionID = regionID;
        this.obj = obj;
        this.marketCode = marketCode;
        this.classCode = classCode;
        this.exRightDate = exRightDate;
		this.exRightDateL = CodeTool.DateToLong(exRightDate);
        this.recordeDate = recordeDate;
		this.recordeDateL = CodeTool.DateToLong(recordeDate);
        this.checkInRightDate = checkInRightDate;
		this.checkInRightDateL = CodeTool.DateToLong(checkInRightDate);
        this.checkInProfitsDate = checkInProfitsDate;
		this.checkInProfitsDateL = CodeTool.DateToLong(checkInProfitsDate);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRegionID() {
        return regionID;
    }

    public void setRegionID(String regionID) {
        this.regionID = regionID;
    }

    public String getObj() {
        return obj;
    }

    public void setObj(String obj) {
        this.obj = obj;
    }

    public String getMarketCode() {
        return marketCode;
    }

    public void setMarketCode(String marketCode) {
        this.marketCode = marketCode;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public Date getExRightDate() {
        return exRightDate;
    }

    public void setExRightDate(Date exRightDate) {
        this.exRightDate = exRightDate;
        this.setExRightDateL(CodeTool.DateToLong(exRightDate));
    }

    public Date getRecordeDate() {
        return recordeDate;
    }

    public void setRecordeDate(Date recordeDate) {
        this.recordeDate = recordeDate;
		this.setRecordeDateL(CodeTool.DateToLong(recordeDate));
    }

    public Date getCheckInRightDate() {
        return checkInRightDate;
    }

    public void setCheckInRightDate(Date checkInRightDate) {
        this.checkInRightDate = checkInRightDate;
		this.setCheckInRightDateL(CodeTool.DateToLong(checkInRightDate));
    }

    public Date getCheckInProfitsDate() {
        return checkInProfitsDate;
    }

    public void setCheckInProfitsDate(Date checkInProfitsDate) {
        this.checkInProfitsDate = checkInProfitsDate;
		this.setCheckInProfitsDateL(CodeTool.DateToLong(checkInProfitsDate));
    }

    public Integer getDenominator() {
        return denominator;
    }

    public void setDenominator(Integer denominator) {
        this.denominator = denominator;
    }

    public Integer getMemberA() {
        return memberA;
    }

    public void setMemberA(Integer memberA) {
        this.memberA = memberA;
    }

    public Integer getMemberB() {
        return memberB;
    }

    public void setMemberB(Integer memberB) {
        this.memberB = memberB;
    }

    public Float getProfits() {
        return profits;
    }

    public void setProfits(Float profits) {
        this.profits = profits;
    }

    public String getReMark() {
        return reMark;
    }

    public void setReMark(String reMark) {
        this.reMark = reMark;
		this.setReMarkBit(CodeTool.StringToBit(reMark));
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistoryObjExRightInfo)) {
            return false;
        }
        HistoryObjExRightInfo other = (HistoryObjExRightInfo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.history.HistoryObjExRightInfo[ id=" + id + " ]";
    }

    public long getExRightDateL() {
        return exRightDateL;
    }

    public void setExRightDateL(long exRightDateL) {
        this.exRightDateL = exRightDateL;
		this.exRightDate = CodeTool.LongToDate(exRightDateL);
    }

    public long getRecordeDateL() {
        return recordeDateL;
    }

    public void setRecordeDateL(long recordeDateL) {
        this.recordeDateL = recordeDateL;
		this.recordeDate = CodeTool.LongToDate(recordeDateL);
    }

    public long getCheckInRightDateL() {
        return checkInRightDateL;
    }

    public void setCheckInRightDateL(long checkInRightDateL) {
        this.checkInRightDateL = checkInRightDateL;
		this.checkInRightDate = CodeTool.LongToDate(checkInRightDateL);
    }

    public long getCheckInProfitsDateL() {
        return checkInProfitsDateL;
    }

    public void setCheckInProfitsDateL(long checkInProfitsDateL) {
        this.checkInProfitsDateL = checkInProfitsDateL;
		this.checkInProfitsDate = CodeTool.LongToDate(checkInProfitsDateL);
    }

    public byte[] getReMarkBit() {
        return reMarkBit;
    }

    public void setReMarkBit(byte[] reMarkBit) {
        this.reMarkBit = reMarkBit;
		this.reMark = CodeTool.BitToString(reMarkBit);
    }
    
}
